import Vue from 'vue'
import App from './App.vue'
import router from './router'
import singleSpaVue from 'single-spa-vue'

Vue.config.productionTip = false

const appOptions = {
  el: '#vue',
  router,
  render: (h) => h(App),
}

const vueLifeCycle = singleSpaVue({ Vue, appOptions })

// 如果父应用 引用我时,定位到当前网页
if (window.singleSpaNavigate) {
  __webpack_public_path__ = 'http://localhost:10005/'
}

// 如果单独启用此项目时
if (!window.singleSpaNavigate) {
  delete appOptions.el
  new Vue(appOptions).$mount('#app')
}

export const bootstrap = vueLifeCycle.bootstrap // 启动时
export const mount = vueLifeCycle.mount // 挂载时
export const unmount = vueLifeCycle.unmount // 卸载时
